/*     */ package com.chw.admin.sysiconinfo;
/*     */ 
/*     */ import com.chw.annotation.PermissionSecurity;
/*     */ import com.chw.common.ServiceData;
/*     */ import com.chw.common.ServiceData.RetCode;
/*     */ import com.chw.utils.LogUtil;
/*     */ import com.github.pagehelper.PageInfo;
/*     */ import com.google.gson.Gson;
/*     */ import java.util.List;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/sysUploadFiles"})
/*     */ public class SysUploadFilesController
/*     */ {
/*  23 */   private static LogUtil log = LogUtil.newInstance(SysUploadFilesController.class);
/*     */ 
/*     */   @Autowired
/*     */   private ISysUploadFilesService sysUploadFilesService;
/*     */ 
/*  32 */   @RequestMapping(value={"/findSysUploadFiles.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="活动文件", btnfunc="select_sysUploadFiles")
/*     */   public ServiceData findSysUploadFiles(HttpServletRequest request, SysUploadFiles sysUploadFiles, Integer currentPage, Integer pageSize) throws Exception { log.info("findSysUploadFiles");
/*  33 */     ServiceData ret = new ServiceData();
/*     */ 
/*  35 */     PageInfo rta = this.sysUploadFilesService.find(sysUploadFiles, currentPage, pageSize);
/*  36 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  37 */     ret.setBo(rta);
/*  38 */     return ret; }
/*     */ 
/*     */   @RequestMapping(value={"/saveSysUploadFiles.do"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="新增", module="新增图片", btnfunc="add_sysUploadFiles")
/*     */   public ServiceData saveSysUploadFiles(HttpServletRequest request, String param) throws Exception {
/*  47 */     log.info("saveSysUploadFiles");
/*  48 */     ServiceData ret = new ServiceData();
/*  49 */     Gson gson = new Gson();
/*  50 */     SysUploadFiles sysUploadFiles = (SysUploadFiles)gson.fromJson(param, SysUploadFiles.class);
/*  51 */     int i = this.sysUploadFilesService.save(sysUploadFiles);
/*  52 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  53 */     ret.setBo(Integer.valueOf(i));
/*  54 */     return ret;
/*     */   }
/*  62 */   @RequestMapping(value={"/updateSysUploadFiles.do"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="修改", module="编辑活动", btnfunc="update_sysUploadFiles")
/*     */   public ServiceData updateSysUploadFiles(HttpServletRequest request, SysUploadFiles sysUploadFiles) throws Exception { ServiceData ret = new ServiceData();
/*  63 */     int i = this.sysUploadFilesService.update(sysUploadFiles);
/*  64 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  65 */     ret.setBo(Integer.valueOf(i));
/*  66 */     return ret; }
/*     */ 
/*     */   @RequestMapping(value={"/findSysUploadFilesByRefId.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据引用id查找图片", btnfunc="select_sysUploadFiles")
/*     */   public ServiceData findSysUploadFilesByRefId(HttpServletRequest request, String refId, Integer currentPage, Integer pageSize) throws Exception {
/*  75 */     ServiceData ret = new ServiceData();
/*  76 */     PageInfo list = this.sysUploadFilesService.findByRefIdOnPage(refId, currentPage, pageSize);
/*  77 */     ret.setBo(list);
/*  78 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  79 */     return ret;
/*     */   }
/*     */   @RequestMapping(value={"/findSysUploadFilesByRefIdList.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据引用id查找图片", btnfunc="select_sysUploadFiles")
/*     */   public ServiceData findSysUploadFilesByRefIdList(HttpServletRequest request, String refId) throws Exception {
/*  88 */     ServiceData ret = new ServiceData();
/*  89 */     List list = this.sysUploadFilesService.findByRefId(refId);
/*  90 */     ret.setBo(list);
/*  91 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  92 */     return ret;
/*     */   }
/*     */   @RequestMapping(value={"/findSysUploadFilesById.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据Id查询图片", btnfunc="select_sysUploadFiles")
/*     */   public ServiceData findSysUploadFilesById(HttpServletRequest request, String sysUploadFilesId) throws Exception {
/* 101 */     ServiceData ret = new ServiceData();
/* 102 */     SysUploadFiles sysUploadFiles = this.sysUploadFilesService.findById(sysUploadFilesId);
/* 103 */     ret.setBo(sysUploadFiles);
/* 104 */     ret.setCode(request, ServiceData.RetCode.Success);
/* 105 */     return ret;
/*     */   }
/*     */ }

/* Location:           E:\chenya\2017 4-21\com.chw\admin\sysiconinfo\
 * Qualified Name:     com.chw.admin.sysiconinfo.SysUploadFilesController
 * JD-Core Version:    0.6.0
 */